package com.xinqi.controller;

import com.xinqi.common.R;
import com.xinqi.service.GoodsOrderService;
import com.xinqi.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author xin麒
 * @date 2023/2/17 15:15
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

//    @Resource
//    private IGoodsService goodsService;

    @Autowired
    private GoodsOrderService goodsOrderService;
    @GetMapping("/buyGoodByUserId/{goodsId}/{userId}")
    public R buyGoodsByUserId(@PathVariable("goodsId") Long goodsId,@PathVariable("userId") Long UserId){
        return goodsOrderService.buyOneGoods(goodsId,UserId);
    }


}
